import { Component, OnInit, Input, EventEmitter, Output, Host, Inject, forwardRef, ViewChild, ElementRef, AfterViewInit } from '@angular/core';

import { RemoveTableService } from '../../../public/serve/remove-table/remove-table.service';
import { Service } from '../../../server/server';
import { HintsService } from '../../../public/serve/hints/hints.service';
declare var $: any;


@Component({
  selector: 'app-management-delete',
  templateUrl: './management-delete.component.html',
})
export class ManagementDeleteComponent implements OnInit {

  constructor(
    private removeTableService: RemoveTableService,
    private server: Service,
    private hintsService:HintsService
  ) { }

  ngOnInit() {
  }
  @Output()
  deleteOutput: EventEmitter<string> = new EventEmitter();
  // 确认删
  confirmDel() {
    let url = this.server.baseUrl+'admin/pusers/delete';
    //console.log(this.removeTableService.getRemoveTableId)
    this.removeTableService.confirmRemove('userId', url).then((res: any) => {
      this.deleteOutput.emit(res.result_code);
      this.hintsService.messages(res.message,res.result_code);
      if (res.result_code == '0000') {
        $("#delete").modal("hide");
      }
    }).catch()
  }

}
